<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    let years=Number(prompt('请输入年份'))
    let month=Number(prompt('请输入月份'))


  
    
    switch(month) {
      case 1: case 3:case 5:case 7: case 8:case 10:case 12:alert(`${month}月有31天`)
      break
      case 4: case 6:case 9:case 11: alert(`${month}月有30天`)
      break
      case 2: 
      if(month===2){
      if(years%400===0||years%4===0&&years%4!==0)
      
      {
       alert(`${month}月有28天`) 
      }
      else {
       alert(`${month}月有29天`)
      }
    }
     break
      default:
      alert('没有该月份')


    }


  </script>
  
</body>
</html>